package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Collect generated by hbm2java
 */
@Entity
@Table(name = "collect", catalog = "shop")
public class Collect implements java.io.Serializable {

	private Integer collectId;
	private Shop shop;
	private Product product;
	private int custId;
	private Date collectDate;
	private String collectType;

	public Collect() {
	}

	public Collect(int custId, Date collectDate, String collectType) {
		this.custId = custId;
		this.collectDate = collectDate;
		this.collectType = collectType;
	}

	public Collect(Shop shop, Product product, int custId, Date collectDate,
			String collectType) {
		this.shop = shop;
		this.product = product;
		this.custId = custId;
		this.collectDate = collectDate;
		this.collectType = collectType;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "collect_id", unique = true, nullable = false)
	public Integer getCollectId() {
		return this.collectId;
	}

	public void setCollectId(Integer collectId) {
		this.collectId = collectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shop_id")
	public Shop getShop() {
		return this.shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "prod_id")
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "cust_id", nullable = false)
	public int getCustId() {
		return this.custId;
	}

	public void setCustId(int custId) {
		this.custId = custId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "collect_date", nullable = false, length = 19)
	public Date getCollectDate() {
		return this.collectDate;
	}

	public void setCollectDate(Date collectDate) {
		this.collectDate = collectDate;
	}

	@Column(name = "collect_type", nullable = false, length = 8)
	public String getCollectType() {
		return this.collectType;
	}

	public void setCollectType(String collectType) {
		this.collectType = collectType;
	}

}
